summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/APIDump/Hooks/OnPlayerBrokenBlock.lua
blob: e718c5d976d78b1b4ccf001d9b07deba5e9631a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
return
{
	HOOK_PLAYER_BROKEN_BLOCK =
	{
		CalledWhen = "After a player has broken a block. Notification only.",
		DefaultFnName = "OnPlayerBrokenBlock",  -- also used as pagename
		Desc = [[
			This function is called after a {{cPlayer|player}} breaks a block. The block is already removed
			from the {{cWorld|world}} and {{cPickup|pickups}} have been spawned. To get the world in which the
			block has been dug, use the {{cPlayer}}:GetWorld() function.</p>
			<p>
			See also the {{OnPlayerBreakingBlock|HOOK_PLAYER_BREAKING_BLOCK}} hook for a similar hook called
			before the block is broken. To intercept the creation of pickups, see the
			{{OnBlockToPickups|HOOK_BLOCK_TO_PICKUPS}} hook.
		]],
		Params =
		{
			{ Name = "Player", Type = "{{cPlayer}}", Notes = "The player who broke the block" },
			{ Name = "BlockX", Type = "number", Notes = "X-coord of the block" },
			{ Name = "BlockY", Type = "number", Notes = "Y-coord of the block" },
			{ Name = "BlockZ", Type = "number", Notes = "Z-coord of the block" },
			{ Name = "BlockFace", Type = "number", Notes = "Face of the block upon which the player interacted. One of the BLOCK_FACE_ constants" },
			{ Name = "BlockType", Type = "BLOCKTYPE", Notes = "The block type of the block" },
			{ Name = "BlockMeta", Type = "NIBBLETYPE", Notes = "The block meta of the block" },
		},
		Returns = [[
			If the function returns false or no value, the next plugin's callback is called. If the function
			returns true, no other callback is called for this event.
		]],
	},  -- HOOK_PLAYER_BROKEN_BLOCK
}